package com.haiyou.dc.oa.util;

import com.github.pagehelper.PageInfo;
import com.haiyou.common.util.R;

import java.util.HashMap;

/**
 * layui工具类
 **/
public class Layui {

    /**
     * 用于返回Layui表格
     *
     * @param pageInfo
     * @return
     */
    public static R ok(PageInfo pageInfo) {
        R r = new R();
        HashMap<String, Object> hashMap = new HashMap<>(2);
        hashMap.put("count", pageInfo.getTotal());
        hashMap.put("data", pageInfo.getList());
        hashMap.put("msg", "");
        hashMap.put("code", "0");
        r.putAll(hashMap);
        return r;
    }
}